home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 079c.dms / 079c.adf / minimaze.lha / MiniMAZE.Amos / MiniMAZE.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1992-02-26  |  3.4 KB  |  166 lines

  1. ' M.A.Z.E.  v1.0�
  2. '
  3. ' ï¿½1995 Mike Richmond  
  4. '
  5. ' The full version (which will NEVER be released :-) features IFF piccies, 
  6. ' a Rave-ey title tune and in-game music that changes speed as you get 
  7. ' further up the screen.  Can you find the cheat mode? 
  8. '
  9. ' Right button drops a bomb, mouse moves player.  The idea is to get to the
  10. ' top of the screen as fast as possible.  It is VERY easy to do it in 0  
  11. ' seconds but I won#t tell you how...
  12. '
  13. ' Note : This code is badly structured and sparsely commented. 
  14. '
  15. ' But I don't care...
  16. '
  17. _START:
  18. '
  19. Screen Open 0,320,200,16,Lowres
  20. '
  21. Led Off : Hide On : Curs Off : Flash Off 
  22. ' Standard stuff 
  23. '
  24. Centre "M.A.Z.E. by Mike Richmond"
  25. Print : Print : Print 
  26. Centre "Press left mouse to play..."
  27. Print : Print : Print 
  28. Centre "If you dare!"
  29. '
  30. ' The Title Screen 
  31. Repeat 
  32.    X$=Inkey$
  33.    If X$="c"
  34.       CHEAT=1
  35.    End If 
  36.    If X$="d"
  37.       CHEAT=0
  38.    End If 
  39. Until Mouse Key=1
  40. '
  41. '  
  42. Screen Open 0,320,200,4,Lowres
  43. Palette $0,$0,$0,$0
  44. Flash Off : Curs Off 
  45. BOMBS=9
  46. '
  47. '
  48. '
  49. Cls 0
  50. '
  51. Pen 1 : Paper 0
  52. '
  53. ' This routine generates a random maze from the / and \ characters.  Coders
  54. ' who used to have a C64 may remember this routine from the C64 manual!
  55. For X=0 To 39
  56.    For Y=1 To 23
  57.       M=Rnd(1)
  58.       If M=0 Then A$="/"
  59.       If M=1 Then A$="\"
  60.       Locate X,Y
  61.       Print A$;
  62.    Next 
  63. Next 
  64. '
  65. Fade 4,$0,$FFF,$F00,$FF0
  66. Ink 0 : Bar 0,0 To 319,7 : Home : Centre "Move Mouse to Bottom of Screen and Click"
  67. '
  68. Show On 
  69. '
  70. Repeat 
  71. Until Y Mouse>198 and Mouse Key<>0
  72. '
  73. '
  74. Ink 0 : Bar 0,0 To 319,7
  75. A$="BOMBS -"+Str$(BOMBS)
  76. Ink 2,0 : Text 0,8,A$
  77. Hide On 
  78. Flash 1,"(777,3)(888,3)(999,3)(aaa,3)(bbb,3)(ccc,3)(ddd,3)(eee,3)(fff,3)(eee,3)(ddd,3)(ccc,3)(bbb,3)(aaa,3)(999,3)(888,3)"
  79. '
  80. X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  81. OX=X : OY=Y
  82. Plot X,Y,2
  83. TIME=0
  84. '
  85. ' Resets everything
  86. '
  87. Do 
  88.    X=X Screen(X Mouse)
  89.    Y=Y Screen(Y Mouse)
  90.    Sprite 0,X Hard(X),Y Hard(Y),1
  91.    '
  92.    T=(200-Y)/4
  93.    If T<10 Then T=10
  94.    Tempo T
  95.    '
  96.    If Y=0 Then Goto _WIN
  97.    '
  98.    If Point(X,Y)=1
  99.       Goto _LOSE
  100.    End If 
  101.    '
  102.    Draw OX,OY To X,Y
  103.    OX=X : OY=Y
  104.    '
  105.    ' Your droid leaves a trail so you can chart your progress through the 
  106.    ' maze.  
  107.    '
  108.    If Mouse Click=2 and BOMBS>0
  109.       Ink 3
  110.       For C=1 To 7
  111.          Circle X,Y,C
  112.       Next 
  113.       '
  114.       ' Bomb routine actually leaves rubble!  First, it draws 7 circles
  115.       ' with increasing radii (in yellow)
  116.       '
  117.       Ink 0
  118.       For C=1 To 7
  119.          Circle X,Y,C
  120.       Next 
  121.       '
  122.       ' Then in black to delete them!
  123.       '
  124.       Ink 2,0
  125.       If CHEAT=0
  126.          Dec BOMBS
  127.       End If 
  128.       A$="BOMBS -"+Str$(BOMBS)
  129.       Text 0,8,A$
  130.    End If 
  131.    '
  132.    ' Prints the number of bombs on the screen 
  133.    '
  134.    Inc TIME
  135.    ' Increases the TIME variable, held in Vbls for conversion later 
  136.    Wait Vbl 
  137. Loop 
  138. '
  139. _WIN:
  140. Sprite Off : Flash Off : Pen 2 : Paper 0
  141. '
  142. Fade 4,$0,$0,$0,$0 : Wait 100 : Cls 
  143. Screen Open 0,320,200,16,Lowres
  144. Flash Off : Curs Off 
  145. Home : Print : Print : Print : Centre "You win!"
  146. A$="You took -"+Str$(Int(TIME/50))+" Seconds"
  147. Print : Print : Print : Pen 2 : Paper 0 : Centre A$
  148. Goto _END
  149. '
  150. _LOSE:
  151. Sprite Off : Flash Off : Pen 2 : Paper 0
  152. Boom 
  153. '
  154. Fade 4,$0,$0,$0,$0 : Wait 100 : Cls 
  155. Screen Open 0,320,200,16,Lowres
  156. Flash Off : Curs Off 
  157. Home : Print : Print : Print : Centre "You lose!"
  158. A$="You lasted -"+Str$(Int(TIME/50))+" Seconds"
  159. Home : Print : Print : Print : Pen 2 : Paper 0 : Centre A$
  160. '
  161. _END:
  162. Repeat 
  163. Until Mouse Key<>0
  164. Fade 4
  165. Wait 100 : Cls : Home 
  166. Goto _START